<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Command Test</title>
</head>
<body>
<iframe id="responseFrame" src="/notify?userId=alecsiel">

</iframe>
<script>
function doCommand() {
	var oldCommandRequest = document.getElementById("cmdRequest");
	if(oldCommandRequest != null) {
		document.body.removeChild(oldCommandRequest);
	}
	var cmd = document.getElementById("command");
	var cmdRequest = document.createElement("script");
	//document.getElementById("commandRequest");
	//alert(cmdRequest);
	var date = new Date(); // cache remove
	cmdRequest.src = "command?command=" + cmd.value + "&userId=alecsiel" + "&time=" + date.getTime();
	cmdRequest.id = "cmdRequest";
	document.body.appendChild(cmdRequest);
}
</script>

<br><input type="text" id="command" value="build:woodcutter" />
<br><input type="button" onclick="doCommand();" value="command"/>
</body>
</html>